﻿using System;

namespace Event.Authentication.EventPattern
{
    public class RewardService
    {
        private readonly UserService _userService;

        public RewardService(UserService userService)
        {
            _userService = userService;
            _userService.UserRegistered += Reward;
        }

        public void Reward(UserRegisteredEventArgs user)
        {
            if (ShouldReward(user))
            {
                Console.WriteLine("reward successfully");
            }
        } 

        private bool ShouldReward(UserRegisteredEventArgs user)
        {
            return true;
        }
    }
}